<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
  //1 function 方法名(){}
  //1.1无参无返回值
  function f1(){
    console.log("f1");
  }
  f1();
  //1.2有参无返回值
  function f2(name,age){
    console.log(name+":"+age);
  }
  f2("张三",18);
  //1.3 无参有返回值
  function f3(){
      return "我是返回值";
  }
  let value = f3();
  console.log(value);
  //1.4有参有返回值
  function f4(x,y){
      return x+y;
  }
  let result = f4();
  console.log(result);
  //2 let 方法名= function（参数）{方法体}
  let f5 = function (x,y){
      console.log(x+y);
  };
  f5(2,3);
  //3 let 方法名 = new Function("参数1","参数2"..."方法体")
  let f6 = new Function("x","y","console.log(x+y)");
  f6(6,4);

</script>

</body>
</html>